home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util1 / yk211src.lha / Yak_2.11_Src / WBStartup / FullWorkBench.c < prev    next >
C/C++ Source or Header  |  1995-10-18  |  2KB  |  99 lines

  1. #include <string.h>
  2. #include <stdlib.h>
  3. #include <proto/intuition.h>
  4. #include <proto/exec.h>
  5. #include <exec/ports.h>
  6. #include <dos/dos.h>
  7. #include <proto/dos.h>
  8. #include <dos/notify.h>
  9. #include <exec/memory.h>
  10.  
  11. #include "FullWorkbench.h"
  12.  
  13.  
  14. VOID
  15. MakeOtherBackdropsVisible( struct Screen *WBScreen )
  16. {
  17.     struct Window *Backdrop;
  18.  
  19.     /* if there are other backdrop windows, bring them to front */
  20.     /* For instance, some title screen clocks */
  21.  
  22.     Forbid();
  23.     Backdrop = WBScreen->FirstWindow; 
  24.     while (Backdrop)
  25.     { 
  26.         if ((Backdrop->Flags & WFLG_BACKDROP) && 
  27.             !(Backdrop->Flags & WFLG_WBENCHWINDOW))
  28.         {    
  29.             WindowToFront(Backdrop);
  30.         }
  31.         Backdrop = Backdrop->NextWindow;
  32.     }
  33.     Permit();
  34. }
  35.  
  36.  
  37. VOID 
  38. ToggleFullWorkbench ( BOOL Toggle)
  39. {
  40.     struct Screen *WBScreen;
  41.     struct Window *WBWin;
  42.   
  43.     if (WBScreen = (struct Screen *)LockPubScreen("Workbench"))
  44.     {
  45.         /* Find the backdrop window of the workbench if it exists */
  46.  
  47.         Forbid();
  48.         WBWin = WBScreen->FirstWindow; 
  49.         while (WBWin && !((WBWin->Flags & WFLG_BACKDROP) && (WBWin->Flags & WFLG_WBENCHWINDOW)))
  50.         { 
  51.             WBWin = WBWin->NextWindow;
  52.         }
  53.         Permit();
  54.  
  55.         if (WBWin)
  56.         {
  57.             /* WB Backdrop window exists */
  58.  
  59.             if(Toggle) 
  60.             {
  61.                 if (WBWin->Height < WBScreen->Height)
  62.                 {
  63.                     /* Enlarge the backdrop window so that picture covers all screen */
  64.                     ChangeWindowBox(WBWin,
  65.                                     WBWin->LeftEdge,
  66.                                     0, 
  67.                                     WBWin->Width,
  68.                                     WBScreen->Height);
  69.                 }
  70.                 
  71.                 /* Hide the workbench screen title bar */
  72.                 ShowTitle(WBScreen, FALSE);
  73.  
  74.                 MakeOtherBackdropsVisible( WBScreen );
  75.  
  76.             }
  77.             else
  78.             {
  79.                 if (WBWin->Height == WBScreen->Height)
  80.                 {
  81.                     /* Reduce the backdrop window so that it is right under the title bar */
  82.                     ChangeWindowBox(WBWin,
  83.                                     WBWin->LeftEdge,
  84.                                     (WBScreen->BarHeight+1),
  85.                                     WBWin->Width,
  86.                                     WBScreen->Height-(WBScreen->BarHeight+1));
  87.                     WindowToBack(WBWin);
  88.  
  89.                     /* Show the workbench screen title bar */
  90.                     ShowTitle(WBScreen, TRUE);
  91.  
  92.                     MakeOtherBackdropsVisible( WBScreen );
  93.                 }
  94.             }
  95.         }
  96.         UnlockPubScreen(NULL, WBScreen);
  97.     }
  98. }
  99.